/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Jiang Jinxi
 * Date: 2024-04-20
 * Time: 15:19
 */
public class RegularPolygon {
    private int n = 3;
    private double size = 1;
    private double x;
    private double y;
    public RegularPolygon(){

    }
    public RegularPolygon(int n,double size){
        this.n=  n;
        this.size = size;
    }

    public RegularPolygon(int n, double size, double x, double y) {
        this.n = n;
        this.size = size;
        this.x = x;
        this.y = y;
    }

    public int getN() {
        return n;
    }

    public void setN(int n) {
        this.n = n;
    }

    public double getSize() {
        return size;
    }

    public void setSize(double size) {
        this.size = size;
    }

    public double getX() {
        return x;
    }

    public void setX(double x) {
        this.x = x;
    }

    public double getY() {
        return y;
    }

    public void setY(double y) {
        this.y = y;
    }
    public double getPerimeter(){
        return n*size;
    }
    public double getArea(){
        double area = (n*size*size)/4*Math.tan(Math.PI/n);
        return area;
    }
}
